package smu.KYBank.test;

import smu.KYBank.KYBlogin;
import android.test.ActivityInstrumentationTestCase2;
import android.test.TouchUtils;
import android.view.KeyEvent;
import android.widget.EditText;

public class KYBloginTest5 extends ActivityInstrumentationTestCase2<KYBlogin> {
	private KYBlogin mActivity;
	EditText et_login_id, et_login_pw;

	public KYBloginTest5() {
		super("smu.KYBank", KYBlogin.class);
	}
		
	protected void setUp() throws Exception {
		super.setUp();
		
		mActivity = this.getActivity();

		et_login_id = (EditText) mActivity.findViewById(smu.KYBank.R.id.login_id);
		et_login_pw = (EditText) mActivity.findViewById(smu.KYBank.R.id.login_pw);
	}
	
	// case 5: PW is wrong. -> return false;
	public void testCheckIdPw() {
		TouchUtils.tapView(this, et_login_id);
		sendKeys(KeyEvent.KEYCODE_K, KeyEvent.KEYCODE_Y, KeyEvent.KEYCODE_O, KeyEvent.KEYCODE_N, KeyEvent.KEYCODE_G);
		TouchUtils.tapView(this, et_login_pw);
		sendKeys(KeyEvent.KEYCODE_1, KeyEvent.KEYCODE_2, KeyEvent.KEYCODE_0, KeyEvent.KEYCODE_0);

		assertEquals(false, mActivity.checkIdPw());
	}

}
